
Create PROCEDURE SP_LogoInformationById
	@Id DateTime
AS
BEGIN
	select * from LogoInformation li
	where li.Id=@Id

	Select tl.Description as MenuName , d.* from LogoDetail d inner join tblLookup tl on tl.LookUpID=d.MenuId where d.LogoInformationId in (select li.Id from LogoInformation li
	where li.Id=@Id)

	Select * from LogoDetailDetail ddl where ddl.LogoDetailId in (select li.Id from LogoInformation li
	where li.Id=@Id)
	
END
GO


USE [Azad]
GO
/****** Object:  StoredProcedure [dbo].[SP_LogoInformation]    Script Date: 11/27/2011 23:01:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[SP_LogoInformation] 
	@CurrentDate DateTime
AS
BEGIN
	select * from LogoInformation li
	where li.CurrentDate=@CurrentDate

	Select tl.Description as MenuName , d.* from LogoDetail d inner join tblLookup tl on tl.LookUpID=d.MenuId where d.LogoInformationId in (select li.Id from LogoInformation li
	where li.CurrentDate=@CurrentDate)

	Select * from LogoDetailDetail ddl where ddl.LogoDetailId in (select li.Id from LogoInformation li
	where li.CurrentDate=@CurrentDate)
	
END

GO
/****** Object:  StoredProcedure [dbo].[SP_LogoInformation]    Script Date: 11/27/2011 23:01:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

Create PROCEDURE [dbo].[SearchLogoInformation] 
	@CurrentDate DateTime= null
AS
BEGIN
	select * from LogoInformation li
	where li.CurrentDate=isnull(@CurrentDate,li.CurrentDate)
END
